import * as client from './client'
import urlConfig from './urlConfig'
/**
 * 优惠活动
 */


export class PromotionInfoRpn {
    public id?: number;
    public uniqueID?: string;
    /**
     * 活动名称
     */
    public name?: string;
    public type?: number;
    public note?: string;
    /**
     * 开始时间
     */
    public startTime?: string;
    /**
     * 结束时间
     */
    public endTime?: string;
    public subsidy?: string;
    public balanceTime?: string;
    public buyLimit?: string;
    public subsidyRatio?: number
    public orderNumberLimit?: number;
    public orderTimeLimit?: number;
    public status?: number;
}

/**
 * 获取数据
 * @param rst 参数
 */
export async function exec(uid:string) {
    const data = await client.exec(urlConfig.promotionInfo, {promotionUniqueID:uid});
    return JSON.parse(data) as client.RSM<PromotionInfoRpn>;
}